package edu.njucm.herbiv.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author ZhouHang
 * @Date 24/4/25 025
 */
public class ErrorUtils {
    public static Map<String, Object> constructMessage(int code, String msg) {
        Map<String, Object> ret = new HashMap<>();
        ret.put("code", code);
        ret.put("msg", msg);
        return ret;
    }

    public static Map<String, Object> constructMessage(int code, String msg, String key, Object value) {
        Map<String, Object> ret = constructMessage(code, msg);
        ret.put(key, value);
        return ret;
    }
}
